var t = require;
var e = module;
var o = exports;
var n =
        (this && this.__extends) ||
        (function () {
            var t = function (e, o) {
                return (t =
                    Object.setPrototypeOf ||
                    ({__proto__: []} instanceof Array &&
                        function (t, e) {
                            t.__proto__ = e;
                        }) ||
                    function (t, e) {
                        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    })(e, o);
            };
            return function (e, o) {
                function n() {
                    this.constructor = e;
                }
                t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
            };
        })(),
    r =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var r,
                a = arguments.length,
                i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
            return a > 3 && i && Object.defineProperty(e, o, i), i;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var a = t("BootConst"),
    i = t("ConfS"),
    s = t("Const"),
    c = t("LoadImgs"),
    l = t("Platforms"),
    u = t("WatchVideo"),
    p = cc._decorator,
    f = p.ccclass,
    d =
        (p.property,
        (function (t) {
            function e() {
                return (null !== t && t.apply(this, arguments)) || this;
            }
            return (
                n(e, t),
                (e.prototype.init = function () {
                    var t = this;
                    (this.bg = this.node.getComponent(cc.Sprite)),
                        (this.金币 = this.node.getChildByName("金币")),
                        (this.钻石 = this.node.getChildByName("钻石")),
                        (this.txt1 = this.node.getChildByName("txt1").getComponent(cc.Label)),
                        (this.txt2 = this.node.getChildByName("txt2").getComponent(cc.Label)),
                        (this.index = -1),
                        this.node.on(cc.Node.EventType.TOUCH_END, function () {
                            u.default.show(a.dd.rewardBanner, function () {
                                s.default.addMoney(
                                    i.DatasManager.视频横幅[t.index][0],
                                    i.DatasManager.视频横幅[t.index][1],
                                    "视频横幅",
                                    t.txt1.node,
                                    null
                                );
                            });
                        }),
                        (this.node.active = !1);
                }),
                (e.prototype.show = function () {
                    ++this.index >= i.DatasManager.视频横幅.length && (this.index = 0),
                        this.bgSFs
                            ? this.bgSFs.length > this.index && (this.bg.spriteFrame = this.bgSFs[this.index])
                            : ((this.bgSFs = new Array()),
                              l.default.disorder(i.DatasManager.视频横幅),
                              this.loadNextBGSF()),
                        "钻石" == i.DatasManager.视频横幅[this.index][0]
                            ? ((this.金币.active = !1), (this.钻石.active = !0))
                            : ((this.金币.active = !0), (this.钻石.active = !1)),
                        (this.txt1.string = this.txt2.string = "x" + i.DatasManager.视频横幅[this.index][1]);
                }),
                (e.prototype.loadNextBGSF = function () {
                    var t = this;
                    this.bgSFs.length >= i.DatasManager.视频横幅.length ||
                        c.LoadImgs.load(
                            s.default.url_prefix_share + i.DatasManager.视频横幅[this.bgSFs.length][2],
                            !0,
                            function (e) {
                                t.bgSFs.push(e), 1 == t.bgSFs.length && (t.bg.spriteFrame = e), t.loadNextBGSF();
                            }
                        );
                }),
                (e = r([f], e))
            );
        })(cc.Component));
o.default = d;
